package com.octopus.optiworks.controller;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import com.octopus.optiworks.model.Template;

public class TemplateValidator extends CommonValidator {

	@Override
    public boolean supports(Class<?> aClass) {
        return Template.class.isAssignableFrom(aClass);
    }

	@Override
    public void validate(Object o, Errors errors) {
        ValidationUtils.rejectIfEmptyOrWhitespace(errors, "name", "error.name.empty", "Please specify a name.");
    }
}
